package cn.jiyun.service;

import cn.jiyun.mapper.EctMapper;
import cn.jiyun.mapper.RolesMapper;
import cn.jiyun.mapper.UsersMapper;
import cn.jiyun.pojo.Ect;
import cn.jiyun.pojo.Roles;
import cn.jiyun.pojo.Users;
import com.sun.org.apache.xpath.internal.operations.Mod;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
public class UsersServiceImpl implements UsersService {

    @Autowired
   private  UsersMapper usersMapper;

    @Autowired
    private RolesMapper rolesMapper;

    @Autowired
    private EctMapper ectMapper;



    @Override
    public List<Ect> listUser() {
        List<Ect> list = ectMapper.selectAll();
        return list;
    }

    @Override
    public Users login(Users users) {
        return usersMapper.login(users);
    }

    @Override
    public List<Roles> listRole() {
        return rolesMapper.selectAll();
    }

    @Override
    public void addEct(Ect ect) {
        ectMapper.insertSelective(ect);
    }

    @Override
    public void deleteEct(Integer id) {
        ectMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void deletes(Integer id) {
        ectMapper.deletes(id);
    }


}
